package ru.gelin.android.bells;

import java.util.Date;

import android.content.Context;
import android.content.Intent;
import android.content.BroadcastReceiver;

/**
 *  Broadcast receiver which receives event about boot complete.
 *  Starts AlarmActitity.
 */
public class BootCompletedReceiver extends BroadcastReceiver
        implements Constants {

    public void onReceive (Context context, Intent intent) {
        Date now = new Date();
        TimerStorage timers = TimerStorage.getInstance(context);
        timers.load();
        timers.normalize(now);
        timers.save();
        timers.scheduleAlarm(now);
    }

}
